﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:EIA.SLClient.ProjectManage.Progress"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:EIA_SLClient_Utility_Behaviors="clr-namespace:EIA.SLClient.Utility.Behaviors;assembly=EIA.SLClient.Utility"
	mc:Ignorable="d"
	x:Class="EIA.SLClient.ProjectManage.Progress.ProjectProgressView"
	d:DesignWidth="1024" d:DesignHeight="480">
	<UserControl.Resources>
		<local:ProjectProgressViewModel x:Key="ProjectProgressViewModelDataSource" />
		<DataTemplate x:Key="ProgressDataTemplate">
			<Grid d:DesignWidth="100">
				<TextBlock TextWrapping="Wrap" Text="{Binding ConverterParameter=XMJD, Converter={StaticResource DicItemConverter}, Mode=OneWay}" d:LayoutOverrides="Width" VerticalAlignment="Center" Margin="4"/>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource ProjectProgressViewModelDataSource}}">
		<i:Interaction.Triggers>
			<i:EventTrigger>
				<ei:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="OnLoad"/>
			</i:EventTrigger>
		</i:Interaction.Triggers>
		<Grid Margin="8">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="144"/>
				<ColumnDefinition/>
				<ColumnDefinition Width="400"/>
			</Grid.ColumnDefinitions>
			<ListBox ItemsSource="{Binding ProgressCollection}" BorderBrush="{x:Null}" ItemTemplate="{StaticResource ProgressDataTemplate}" HorizontalContentAlignment="Stretch" SelectedItem="{Binding Progress, Mode=TwoWay}" />
			<Grid Grid.Column="1" Height="240" VerticalAlignment="Top" HorizontalAlignment="Left" Width="448" > <!--Visibility="{Binding Model, Converter={StaticResource NotNull2VisibilityConverter}}" -->
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="80"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" MinHeight="32"/>
					<RowDefinition Height="Auto" MinHeight="32"/>
					<RowDefinition/>
					<RowDefinition Height="48"/>
				</Grid.RowDefinitions>
				<TextBlock Margin="0,0,8,0" TextWrapping="Wrap" Text="进度" d:LayoutOverrides="Height" HorizontalAlignment="Right" VerticalAlignment="Center"/>
				<TextBlock Margin="0,8,8,8" TextWrapping="Wrap" Text="日期" d:LayoutOverrides="Height" HorizontalAlignment="Right" Grid.Row="1"/>
				<TextBlock Margin="0,0,8,0" TextWrapping="Wrap" Text="描述" HorizontalAlignment="Right" Grid.Row="2" VerticalAlignment="Center"/>
				<sdk:DatePicker Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="8,4,0,0" VerticalAlignment="Top" Width="120" SelectedDate="{Binding Model.PrgDate, Mode=TwoWay}" IsEnabled="{Binding IsEditing, Mode=OneWay}" Grid.Row="1" />
				<TextBox Grid.Column="1" Margin="8,16,0,0" Grid.Row="2" TextWrapping="Wrap" VerticalAlignment="Top" Height="104" HorizontalAlignment="Left" Width="360" Text="{Binding Model.PrgDes, Mode=TwoWay}" IsReadOnly="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}">
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:UpdateTextBindingBehavior/>
					</i:Interaction.Behaviors>
				</TextBox>
				<Button Content="取消" Grid.Column="1" HorizontalAlignment="Left" Margin="248,8,0,0" Grid.Row="3" Width="120" Style="{StaticResource bs_clear}" VerticalAlignment="Top" Height="30" FontSize="14.667" Foreground="#FF4C4C4C" Visibility="{Binding IsEditing, Converter={StaticResource Bool2VisibilityConverter}, Mode=OneWay}" Command="{Binding CancelCommand}">
					<Button.Background>
						<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-1.png"/>
					</Button.Background>
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-1.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn1-1.png" Opacity="0.4"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
					</i:Interaction.Behaviors>
				</Button>
				<Button Content="保存" Margin="8,8,0,0" Grid.Row="3" Style="{StaticResource bs_clear}" Height="30" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Left" Width="120" FontSize="14.667" Foreground="White" Visibility="{Binding IsEditing, Converter={StaticResource Bool2VisibilityConverter}, Mode=OneWay}" Command="{Binding SaveCommand}">
					<Button.Background>
						<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
					</Button.Background>
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png" Opacity="0.4"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
					</i:Interaction.Behaviors>
				</Button>
		
				<Button Content="编辑" BorderThickness="0" Padding="0" Style="{StaticResource bs_clear}" Command="{Binding EditCommand}" Margin="248,8,0,0" FontSize="14.667" HorizontalAlignment="Left" Width="120" Foreground="White" VerticalAlignment="Top" Height="30" Visibility="{Binding IsEditing, ConverterParameter=f, Converter={StaticResource Bool2VisibilityConverter}, Mode=OneWay}" IsEnabled="{Binding IsEditing, Converter={StaticResource BoolenRevertConverter}, Mode=OneWay}" Grid.Column="1" Grid.Row="3">
					<Button.Background>
						<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
					</Button.Background>
					<i:Interaction.Behaviors>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
								<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png" Opacity="0.4"/>
							</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
					</i:Interaction.Behaviors>
				</Button>
				<TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="8,0,0,0" TextWrapping="Wrap" Text="{Binding Model.Progress, ConverterParameter=XMJD, Converter={StaticResource DicItemConverter}}" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
			</Grid>
			<!--<Button Content="添加" BorderThickness="0" Padding="0" Style="{StaticResource bs_clear}" Command="{Binding NewCommand}" Margin="8,8,0,0" FontSize="14.667" HorizontalAlignment="Left" Width="120" Foreground="White" VerticalAlignment="Top" Height="30" Grid.Column="1" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Visibility="{Binding Model, ConverterParameter=f, Converter={StaticResource NotNull2VisibilityConverter}}">
				<Button.Background>
					<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
				</Button.Background>
				<i:Interaction.Behaviors>
					<EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
							<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundPressed>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
							<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png"/>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundNormal>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
							<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-2.png"/>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundMouseOver>
						<EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
							<ImageBrush Stretch="Fill" ImageSource="/EIA.SLClient.ProjectManage;component/assets/img/btn2-1.png" Opacity="0.4"/>
						</EIA_SLClient_Utility_Behaviors:Background4StateBehavior.BackgroundDisabled>
					</EIA_SLClient_Utility_Behaviors:Background4StateBehavior>
				</i:Interaction.Behaviors>
			</Button>-->
			<local:DelayApplyView Grid.Column="2" d:LayoutOverrides="Width, Height"/>
		</Grid>
	</Grid>
</UserControl>
